package top.tangyh.lamp.care.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import top.tangyh.basic.base.service.SuperService;
import top.tangyh.lamp.care.entity.BPgRecord;
import top.tangyh.lamp.care.vo.query.PgRecordInVO;
import top.tangyh.lamp.care.vo.query.PgRecordQueryVo;
import top.tangyh.lamp.care.vo.query.QcQueryPageVO;
import top.tangyh.lamp.care.vo.result.BPipeUseRecordResultVO;
import top.tangyh.lamp.care.vo.result.PgRecordOutVO;
import top.tangyh.lamp.care.vo.result.StatisticsByMonth;
import top.tangyh.lamp.care.vo.save.BPgRecordSaveVO;
import top.tangyh.lamp.care.vo.save.PgRecordVo;
import top.tangyh.lamp.care.vo.update.BPgRecordUpdateVO;
import top.tangyh.lamp.care.vo.result.BPgRecordResultVO;
import top.tangyh.lamp.care.vo.query.BPgRecordPageQuery;

import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * <p>
 * 业务接口
 * 评估评分
 * </p>
 *
 * @author zqb
 * @date 2024-07-09 08:35:22
 * @create [2024-07-09 08:35:22] [zqb] [代码生成器生成]
 */
public interface BPgRecordService extends SuperService<Long, BPgRecord> {

    /**
     * 基于病人识别号、住院号、评估时间返回评估记录对象，不包含明细
     *
     * @return List<PgRecordVo>
     */
    List<BPgRecordResultVO> selectByPid(PgRecordQueryVo pgRecordQueryVo);

    Boolean savePgRecordVo(PgRecordVo pgRecordVo);

    /**
     * 基于住院号、评估Id 返回最早一次评估记录，包含明细
     *
     * @return List<PgRecordVo>
     */
    PgRecordVo selectByHp(PgRecordQueryVo pgRecordQueryVo);

    PgRecordVo selectByRecordId(Long id);

    List<PgRecordVo> selectByRecordIds(List<Long> ids);

    void delete(Long pgId);

    PgRecordVo getFirstOfZk(String hospitalNumber);

    /**
     * 仅查询评估记录主表数据
     *
     * @param param 查询参数
     * @return
     */
    List<PgRecordOutVO> queryOnryRecord(PgRecordInVO param) ;

    List<BPgRecord> getPgRecodOfTengTong(String hospitalNumber, String startTime, String endTime, String itemCode);


    /**
     * 保存评估记录
     */
    Boolean saveList(List<PgRecordVo> pgRecordVos, Long recordTime, String operator,String account, String patientIdent, Set<Long> pgpfs);


    Map<Long,PgRecordVo> selectLatestByParams(String patientIdent, String hospitalNumber, Set<Long> pgid, Long recordTime, Long rkTime);


    List<PgRecordVo> getDiseaseOverviewPgRecord(String hospitalNumber,Long rkTime,Long ckTime);


    /**
     * 质控镇痛/镇静评分 分子
     * @param startTime
     * @param endTime
     * @return
     */
    int countOfPainCalmPatient(String startTime,String endTime,String pgName);


    /**
     * 镇痛镇静评分分页查询
     * @param pipeUseRecordQcQueryVO
     * @param pgName
     * @return
     */
    IPage<BPgRecordResultVO> pageOfPgRecord(QcQueryPageVO pipeUseRecordQcQueryVO,String pgName);

    /**
     * 镇痛/镇静评分前六个月按月统计
     * @param startTime
     * @param pgName
     * @return
     */
    List<StatisticsByMonth>  painnCalmStatisticsOfSixMonth(String startTime,String pgName);
}



